/**
 * Description:
 * Class Name:StringReg
 * Date:2022/2/22 11:57
 *
 * @author LTisme
 * @version JAVA17
 */
package 疯狂Java讲义.第7章_Java基础类库._7_5_正则表达式._7_5_2_创建正则表达式;

import java.util.Arrays;

public class StringReg {
    public static void main(String[] args) {
        String[] msgs = {
                "Java has regular expressions in 1.4",
                "regular expressions now expressing in Java",
                "Java expresses oracular expressions",
        };
        for (var msg :
                msgs) {
            System.out.println(msg.replaceFirst("re\\w*", "哈哈："));
            System.out.println(Arrays.toString(msg.split(" ")));
        }
    }
}
